package Userjava.Userpojo;

import Userjava.Userdao.DButil;
import org.springframework.stereotype.Component;

import java.sql.SQLException;

/**
 * 模拟主题和新闻的底层 delete方法
 * */
@Component
public class Topic_NewsDaoImpl {
    /**
     * 删除多条新闻根据主题id
     * */
    public int delNewsByNtid(int ntid) throws SQLException {
        String sql="DELETE FROM `newsmanagersystem`.`news` WHERE nt   id=?";
            return DButil.executeUpdate(sql,new Object[]{ntid});
    }
    /**
     * 删除一条新闻主题id
     * */
    public int delTopicBytid(int tid) throws SQLException {
        String sql="DELETE FROM `newsmanagersystem`.`topic` WHERE `tid` =?";
        return DButil.executeUpdate(sql,new Object[]{tid});
    }
}

